﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
			//连接已经连接了数据库的Admin1000Context表
			Database.SetInitializer(new DbInitalizer());
            using (Admin1000Context db = new Admin1000Context())
            {

                db.Products.ToList();

				//查询内容
                var pro = db.Products.ToList();
                Console.WriteLine("{0}\t\t{1}\t\t{2}\t\t{3}\t", "商品", "价格", "创建时间", "更新时间");
                foreach (var item in pro)
                {
                    Console.WriteLine("{0}\t{1}\t\t{2}\t{3}\t", item.ProductName, item.Price,item.CreationTime,item.UpdateTime);
                }
            }
            Console.Read();
           
        }
    }
}
